package spring.cloud.eurekaclientfund.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.spring.cloud.commonutils.vo.ResultMessage;
import com.spring.cloud.commonutils.vo.UserInfo;

import java.util.List;

@FeignClient("eureka-client-user")
public interface UserFacade {

    @GetMapping("/user/info/{id}")
    public UserInfo getUser(@PathVariable("id") Long id);

    @PutMapping("/user/info")
    public UserInfo putUser(@RequestBody UserInfo userInfo);

    @GetMapping("/user/infoes2")
    public ResponseEntity<List<UserInfo>> findUser2(@RequestParam("ids") Long []ids);

    @DeleteMapping("/user/info")
    public ResultMessage deleteUser(@RequestHeader("id") Long id);

    @PostMapping(value = "/user/upload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public ResultMessage uploadFile(@RequestPart("file") MultipartFile file);
}
